/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.neuralnetwork;

import java.util.ArrayList;

/**
 *
 * @author afspear
 */
public class Function {
    double threshold;
		public double logisticFunction (ArrayList<Input> inputs)
		{
			double sumWeightsAndData = 0;
			
				for (Input item : inputs) {
				sumWeightsAndData += item.data * item.weight;
			}
			//sigmoid function
			double y = 1 / (1 + Math.exp(-(threshold*sumWeightsAndData)));
			return y;
		}
		public Function (double threshold)
		{
			this.threshold = threshold;
		}
    
}
